<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>喜乐康智能家居系统</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<%@taglib uri="/WEB-INF/struts-tags.tld" prefix="s"%> 
	<script type="text/javascript">
		
		$(function(){
			$(".scene_use_img_left").load("<%=basePath%>scene!sceneList.do?currentPage=1&sceneSceneId="+sceneSceneId);
			if(mainSceneId!=''){
			    var yyyyMMddmm = mainSceneTime.split("-");
				$(".scene_use_text").text("${sceneScene.sceneName}"+"  "+yyyyMMddmm[0]+"年"+yyyyMMddmm[1]+"月"+yyyyMMddmm[2]+"日"+yyyyMMddmm[3]+"时"+yyyyMMddmm[4]+"分  "+"开启");
			}
			
		});
		function sceneUseOpen(upDown){
			
			if(upDown=='down'){
				if(currentSceneId == -1) {
					alert("请选择场景！");
					return ;
				}
				$(".scene_use_img_right_open").css("background-image","url('<%=basePath%>resource/scene_use_img_right_open_press.png')");
			}else if(upDown='up'){
				$.post("<%=basePath%>main!openScene.do",{'sceneId':currentSceneId},
						function(){
							var testDate = new Date();
							 var testStr = testDate.format("yyyy年MM月dd日hh时mm分");
							$(".scene_use_text").text($("#scene_use_img_left_list_ul_li"+currentSceneId).text().trim()+"  "+testStr+"开启");
							mainSceneId = currentSceneId;
							mainSceneTime = testDate.format("yyyy-MM-dd-hh-mm");
						});
				$(".scene_use_img_right_open").css("background-image","url('<%=basePath%>resource/scene_use_img_right_open.png')");
				$('.main_left_menu_openClose ul li img').attr("src",evn_Path+"resource/main_left_menu_close.png");
			}
			
		}
	</script>
  </head>
  
  <body>
  	<div class="scene_use_background">
  		<div style="height: 87px;">
	  		<div class="scene_use_text">
	  			无
	  		</div>
	  		<div class="home" onmousedown="backHome('down')" onmouseup="backHome('up');">
	  		</div>
  		</div>
  		<div class="scene_use_img_bg">
  			<div class="scene_use_img_left">
  				
  			</div>
  			<div class="scene_use_img_right">
  				<div class="scene_use_img_right_device">
  					
  				</div>
  				<div class="scene_use_img_right_open" onmousedown="sceneUseOpen('down')" onmouseup="sceneUseOpen('up')">
  					
  				</div>
  			</div>
  		</div>
  	</div>
  </body>
</html>
